package com.hopu.oa.service.impl.task;


import com.hopu.oa.dao.task.TaskDao;
import com.hopu.oa.dao.task.TaskuserDao;
import com.hopu.oa.entity.management.AoaStatusList;
import com.hopu.oa.entity.management.AoaTypeList;
import com.hopu.oa.entity.task.AoaTaskLogger;
import com.hopu.oa.entity.task.AoaTaskUser;
import com.hopu.oa.entity.task.AoaTasklist;
import com.hopu.oa.entity.task.TongJiWangCeng;
import com.hopu.oa.entity.user.AoaUser;
import com.hopu.oa.service.task.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Secret
 * @create 2021-07-17 上午 09:19
 */
@Service
public class TaskServiceImpl implements TaskService {
    @Autowired
    private TaskDao taskMapper;
    @Autowired
    private TaskuserDao taskuserMapper;

    @Override
    public List<AoaTasklist> findAllTask(int userId, String title, int page, int size, String var) {
        return taskMapper.findAllTask(userId, title, (page - 1) * size, size, var);
    }

    @Override
    public int querystatusIdById(int id) {
        return taskuserMapper.querystatusIdById(id);

    }

    @Override
    public List<TongJiWangCeng> selectTongJi() {
        return taskuserMapper.selectTongJi();
    }


    //添加与修改
    @Override
    public List<AoaStatusList> selectBytaskList() {
        return taskMapper.selectBytaskList();
    }

    @Override
    public List<AoaTypeList> selectByTypelist() {
        return taskMapper.selectByTypelist();
    }

    @Override
    public List<AoaUser> selectByfatherId(int uid, String userName, int page, int size) {
        return taskMapper.selectByfatherId(uid, userName, page, size);
    }

    @Override
    public int insertTaskList(AoaTasklist tasklist) {
        return taskMapper.insertTaskList(tasklist);
    }

    @Override
    public int insertIntotaskUser(int statusId, int taskId, int taskReciveUserId) {
        return taskMapper.insertIntotaskUser(statusId, taskId, taskReciveUserId);
    }

    @Override
    public AoaTasklist selectBytaskId(int id) {
        return taskMapper.selectBytaskId(id);
    }

    @Override
    public AoaStatusList selectByStatusListId(int sid) {
        return taskMapper.selectByStatusListId(sid);
    }

    @Override
    public AoaTypeList selectByLypeId() {
        return taskMapper.selectByLypeId();
    }

    @Override
    public int updateTaskList(AoaTasklist tasklist) {
        return taskMapper.updateTaskList(tasklist);
    }

    @Override
    public int insertintoLogger(String starTime, int taskId, String username, int statusId) {
        return taskMapper.insertintoLogger(starTime, taskId, username, statusId);
    }

    //我的任务
    @Override
    public List<AoaTasklist> selectTaskList(int userId, String title, int page, int size) {
        return taskuserMapper.selectTaskList(userId, title, (page - 1) * size, size);
    }

    @Override
    public List<AoaTasklist> findTasklistAll() {
        return taskuserMapper.findTasklistAll();
    }

    @Override
    public List<AoaTaskLogger> findTaskloggerAll() {
        return taskuserMapper.findTaskloggerAll();
    }

    @Override
    public AoaTasklist queryTasklistById(int id) {
        return taskuserMapper.queryTasklistById(id);
    }

    @Override
    public AoaUser queryUserInfoById(int id) {
        return taskuserMapper.queryUserInfoById(id);
    }

    @Override
    public AoaStatusList queryStatusListById(int id) {
        return taskuserMapper.queryStatusListById(id);
    }

    @Override
    public int updateLogger(int loggerStatusid, String loggerTicking, int taskId) {
        return taskuserMapper.updateLogger(loggerStatusid, loggerTicking, taskId);
    }

    @Override
    public int updateTask(int loggerStatusid, int taskId) {
        return taskuserMapper.updateTask(loggerStatusid, taskId);
    }

    @Override
    public int updateTaskUser(int loggerStatusid, int taskId, int uid) {
        return taskuserMapper.updateTaskUser(loggerStatusid, taskId, uid);
    }

    @Override
    public int myshanchu(int id) {
        return taskuserMapper.myshanchu(id);
    }


}
